﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Wys.ClosePopup
{
    public class CClosePopupSection
    {
        public String DllName = "";
        public String ClassName = "";
        public String FindTitleString = "";
    }

    public class ClosePopupConfig
    {
        private static Configuration _config;
        public ClosePopupConfig()
        {
            if (_config == null)
            {
                _config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            }
        }

        public List<CClosePopupSection> GetClosePopupSection()
        {
            List<CClosePopupSection> lst = null ;
            lst = ConfigurationManager.GetSection("ClosePopupSection") as List<CClosePopupSection>;
          
            return lst;
        }

        public String GetAppTitle()
        {
            return _config.AppSettings.Settings["AppTitle"].Value;
        }

        public String GetToken()
        {
            return _config.AppSettings.Settings["SpitToken"].Value;
        }

        public String GetTimeSpan()
        {
            return _config.AppSettings.Settings["TimeSpan"].Value;
        }

        public bool AddClosePopupSection(CClosePopupSection ccs)
        {
            return true;
        }
        public bool UpdateClosePopupSection(CClosePopupSection ccs)
        {
            return true;
        }
    }
}
